@echo off

SET VER=1.7.14.51712
SET NUGET_KEY=cc384668-80a9-4273-bc60-c17223e87302
SET MYGET_KEY=75a16c9c-8070-4f18-865e-961c5976a35d

IF NOT "%1" == "" (
   SET VER=%1
)

echo.
echo ================================================================================
echo ColorWheel.Controls Version %VER%. Package and publish. 
echo.
echo Press Ctrl-C to abort.
echo.
echo ================================================================================
echo.
pause

echo.
echo --------------------------------------------------------------------------------
echo XCopy Sources
echo --------------------------------------------------------------------------------
echo.
rmdir /s /q src
mkdir src
mkdir src\ColorWheel.Silverlight.Controls
mkdir src\ColorWheel.Win.Controls
xcopy ..\ColorWheel.Silverlight.Controls\*.cs src\ColorWheel.Silverlight.Controls /S
xcopy ..\ColorWheel.Silverlight.Controls\*.cs src\ColorWheel.Win.Controls /S
xcopy ..\ColorWheel.Win.Controls\*.cs src\ColorWheel.Win.Controls /S

echo.
echo --------------------------------------------------------------------------------
echo Remove ColorWheel.Core.dll from bin folder
echo --------------------------------------------------------------------------------
echo.
rem del lib\net40\ColorWheel.Core.dll
rem del lib\sl5\ColorWheel.Core.dll

echo.
echo --------------------------------------------------------------------------------
echo Update NuGet
echo --------------------------------------------------------------------------------
echo.
del *.nupkg
nuget Update -self
nuget setApiKey %NUGET_KEY%

echo.
echo --------------------------------------------------------------------------------
echo Create packages
echo --------------------------------------------------------------------------------
echo.
nuget pack ColorWheel.Controls.nuspec -Symbols

echo.
echo --------------------------------------------------------------------------------
echo Publishing to Public Store at www.nuget.org
echo --------------------------------------------------------------------------------
echo.
NuGet Push ColorWheel.Controls.%VER%.nupkg
NuGet Push ColorWheel.Controls.%VER%.symbols.nupkg

echo.
echo --------------------------------------------------------------------------------
echo Publishing to private myget.org http://nuget.gw.symbolsource.org/MyGet/vizdata
echo --------------------------------------------------------------------------------
echo.

nuget push ColorWheel.Controls.%VER%.nupkg %MYGET_KEY% -Source http://www.myget.org/F/vizdata/api/v2/package
nuget push ColorWheel.Controls.%VER%.symbols.nupkg %MYGET_KEY% -Source http://nuget.gw.symbolsource.org/MyGet/vizdata
